Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Configuring Views

QuickDraw 3D provides routines for creating a new view and for getting or setting a view's renderer, camera, light group, and draw context.

Q3View_New

You can use the Q3View_New function to create a new view object.

TQ3ViewObject Q3View_New (void);

DESCRIPTION

The Q3View_New function returns, as its function result, a new view object. Before you can render a model in that view, you must first set the view's renderer, camera, and draw context. You can also set the view's group of lights. Q3View_New returns NULL if it cannot create a new view object.

Q3View_GetRenderer

You can use the Q3View_GetRenderer function to get the renderer associated with a view.

TQ3Status Q3View_GetRenderer (
                     TQ3ViewObject view,
                     TQ3RendererObject *renderer);
view
A view.
renderer
On exit, the renderer object currently associated with the specified view.

DESCRIPTION

The Q3View_GetRenderer function returns, in the renderer parameter, the renderer currently associated with the view specified by the view parameter. The reference count of that renderer is incremented.

Q3View_SetRenderer

You can use the Q3View_SetRenderer function to set the renderer associated with a view.

TQ3Status Q3View_SetRenderer (
                     TQ3ViewObject view,
                     TQ3RendererObject renderer);
view
A view.
renderer
A renderer object.

DESCRIPTION

The Q3View_SetRenderer function attaches the renderer specified by the renderer parameter to the view specified by the view parameter. The reference count of the specified renderer is incremented. In addition, if some other renderer was already attached to the specified view, the reference count of that renderer is decremented.

SEE ALSO

For information on creating and manipulating renderers, see the chapter "Renderer Objects."

Q3View_SetRendererByType

You can use the Q3View_SetRendererByType function to set the renderer associated with a view by specifying its type.

TQ3Status Q3View_SetRendererByType (
                     TQ3ViewObject view,
                     TQ3ObjectType type);
view
A view.
type
A renderer type.

DESCRIPTION

The Q3View_SetRendererByType function attaches the renderer having the type specified by the type parameter to the view specified by the view parameter. The reference count of the specified render is incremented. In addition, if some other renderer was already attached to the specified view, the reference count of that renderer is decremented.

Q3View_GetCamera

You can use the Q3View_GetCamera function to get the camera associated with a view.

TQ3Status Q3View_GetCamera (
                     TQ3ViewObject view,
                     TQ3CameraObject *camera);
view
A view.
camera
On exit, the camera object currently associated with the specified view.

DESCRIPTION

The Q3View_GetCamera function returns, in the camera parameter, the camera currently associated with the view specified by the view parameter. The reference count of that camera is incremented.

Q3View_SetCamera

You can use the Q3View_SetCamera function to set the camera associated with a view.

TQ3Status Q3View_SetCamera (
                     TQ3ViewObject view,
                     TQ3CameraObject camera);
view
A view.
camera
A camera object.

DESCRIPTION

The Q3View_SetCamera function attaches the camera specified by the camera parameter to the view specified by the view parameter. The reference count of the specified camera is incremented. In addition, if some other camera was already attached to the specified view, the reference count of that camera is decremented.

SEE ALSO

For information on creating and manipulating cameras, see the chapter "Camera Objects."

Q3View_GetLightGroup

You can use the Q3View_GetLightGroup function to get the light group associated with a view.

TQ3Status Q3View_GetLightGroup (
                     TQ3ViewObject view,
                     TQ3GroupObject *lightGroup);
view
A view.
lightGroup
On exit, the light group currently associated with the specified view.

DESCRIPTION

The Q3View_GetLightGroup function returns, in the lightGroup parameter, the light group currently associated with the view specified by the view parameter. The reference count of that light group is incremented.

Q3View_SetLightGroup

You can use the Q3View_SetLightGroup function to set the light group associated with a view.

TQ3Status Q3View_SetLightGroup (
                     TQ3ViewObject view,
                     TQ3GroupObject lightGroup);
view
A view.
lightGroup
A light group.

DESCRIPTION

The Q3View_SetLightGroup function attaches the light group specified by the lightGroup parameter to the view specified by the view parameter. The reference count of the specified light group is incremented. In addition, if some other light group was already attached to the specified view, the reference count of that light group is decremented.

SEE ALSO

For information on creating and manipulating light groups, see the chapters "Light Objects" and "Group Objects."

Q3View_GetDrawContext

You can use the Q3View_GetDrawContext function to get the draw context associated with a view.

TQ3Status Q3View_GetDrawContext (
                     TQ3ViewObject view,
                     TQ3DrawContextObject *drawContext);
view
A view.
drawContext
On exit, the draw context currently associated with the specified view.

DESCRIPTION

The Q3View_GetDrawContext function returns, in the drawContext parameter, the draw context currently associated with the view specified by the view parameter. The reference count of that draw context is incremented.

Q3View_SetDrawContext

You can use the Q3View_SetDrawContext function to set the draw context associated with a view.

TQ3Status Q3View_SetDrawContext (
                     TQ3ViewObject view,
                     TQ3DrawContextObject drawContext);
view
A view.
drawContext
A draw context object.

DESCRIPTION

The Q3View_SetDrawContext function attaches the draw context specified by the drawContext parameter to the view specified by the view parameter. The reference count of the specified draw context is incremented. In addition, if some other draw context was already attached to the specified view, the reference count of that draw context is decremented.

SEE ALSO

For information on creating and manipulating draw contexts, see the chapter "Draw Context Objects."


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |